<?php

namespace Template\Compiler\Transformer\Adapters\Php;

use Template\Compiler\Transformer\ATransformer;
use Template\Compiler\Transformer\ITransformer;

class CTransformer extends ATransformer implements ITransformer {

    public function tagStartTemplates (array &$content, array $namespace) {
        array_push($content, '<?php');
        array_push($content, '');
        array_push($content, sprintf('namespace %1$s;', implode('\\', $namespace)));
        array_push($content, '');
        return $content;
    }

    public function tagEndTemplates (array &$content) {
        return $content;
    }

    public function tagStartTemplate (array &$content, $name, array $params) {
        array_push($content, sprintf('class C%1$s extends Template\\CTemplate {', $name));
        array_push($content, '');
        return $content;
    }

    public function tagEndTemplate (array &$content) {
        array_push($content, '}');
        return $content;
    }

    public function tagStartParams () {
        array_push($content, '    public function __construct (array $params) {');
        array_push($content, '        parent::__construct($param);');
        return $content;
    }

    public function tagEndParams () {}

    public function tagStartParam () {}

    public function tagEndParam () {}

}